package com.prj.dy.datamgr.undo
{
	import com.prj.dy.common.DYDispatcher;
	import com.prj.dy.common.DYEvent;
	
	public class DYCmdMgr extends CommandManager
	{	
		public function DYCmdMgr()
		{
			super();			
			this.init();				
		}
		
		protected function init():void
		{
			DYDispatcher.getInstance().addEventListener(DYXmlDataChangeEvent.XML_DATA_ELEM_CHANGE, onXmlDataElemChange); 	
		}
		
		protected function onXmlDataElemChange(event:DYXmlDataChangeEvent):void
		{
			this.executeCommand(new DYXmlDataChangeCmd(event.orgXml, event.newXml, event.propertyName));
		}
	}
}